var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var Person = /** @class */ (function () {
    function Person(name) {
        this.name = name;
        console.log("haha");
        this.name = name;
    }
    Person.prototype.eat = function () {
        console.log(this.name);
        console.log("i'm eating");
    };
    return Person;
}());
var p1 = new Person("batman");
p1.eat();
var p2 = new Person("superman");
p2.eat();
var Employee = /** @class */ (function (_super) {
    __extends(Employee, _super);
    function Employee(name, code) {
        var _this = _super.call(this, name) || this;
        _this.code = code;
        return _this;
    }
    Employee.prototype.work = function () {
        _super.prototype.eat.call(this);
        this.doWork();
    };
    Employee.prototype.doWork = function () {
        console.log("i'm working");
    };
    return Employee;
}(Person));
var e1 = new Employee("em", "123");
e1.work();
//泛型
var workers = [];
workers[0] = new Person("zhangsan");
workers[1] = new Employee("em", "123");
var Person1 = /** @class */ (function () {
    function Person1(config) {
        this.config = config;
    }
    return Person1;
}());
var person1 = new Person1({
    name: "zhangsan",
    age: 18
});
var Sheep = /** @class */ (function () {
    function Sheep() {
    }
    Sheep.prototype.eat = function () {
        console.log("i eat grass");
    };
    return Sheep;
}());
var Tiger = /** @class */ (function () {
    function Tiger() {
    }
    Tiger.prototype.eat = function () {
        console.log("i eat meat");
    };
    return Tiger;
}());
